{extend name="Master/base" /} {block name="title"}后台主页{/block} {block name="main"}

<section class="content-header">
    <h1>
        XXXX管理
    </h1>
    <ol class="breadcrumb">

    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">XXXX信息</h3>
            </div>
            <form role="form" class="validator_form" action="{:url('/Index/Project/File/add')}" id="addProjectFileForm" method="post">
                <input type="hidden" name="id" value="{$info.id?=$info.id}">
                <input type="hidden" id="file_id" name="file_id">
                <input type="hidden" id="project_id" name="project_id" value="{$project_id}">

                <div class="box-body">
                    <div class="form-group">
                        <label>上传文件</label>
                        <br/>
                        <button type="button" class="btn label-primary   webuploader-file" id="project_file">上传文件</button>
                    </div>
                    <div class="form-group">
                        <div>
                            <ul id="project_filelist_file">

                            </ul>
                        </div>
                    </div>


                    <div class="form-group">
                        <label>类型</label>
                        <select name="mtype" class="form-control" required>
                            <option value="">请选择</option>
                                {volist name="file_type" id="file"}
                                <option value="{$file.m_value}">{$file.m_name}</option>
                                {/volist}
                        </select>


                    </div>


                </div>
                <div class="box-footer">
                    <button type="submit" class="btn btn-primary">确认</button>
                </div>

        </div>

        </form>
        <!-- /.box-body -->
    </div>
    </div>
</section>
{/block} {block name="script"}
<script>
    $(function() {
        $("#project_file").webUploadFile({
            Ul_fileList: "project_filelist_file",
            fileIDValue: "file_id",
            filePathValue: "file_name",
            fileNumLimit: 6,
            multiple: true

        }, function(file, response) { //上传完成
            if (response.status == 200) {
                //  $("#user_pic_img").attr("src", response.savename);
                reg = /,$/gi
                var new_file_ids = response.fileid + "," + $("#file_id").val()
                $("#file_id").val(new_file_ids.replace(reg, ""));


                $("#project_filelist_file").append(' <li class="file_name' + response.fileid + '" style="margin-top:10px">' + response.filename + ' <a href="javascript:;" class="label label-danger filedel' + response.fileid + '">删除</a></li>');
            } else {
                bootoast({
                    message: response.filename,
                    type: 'danger',
                    position: 'right-top',
                    timeout: 2
                });
            }
        });
    });
</script>
{/block}